<template>
  <e-cellbox class="placeholder" middle>
    <e-cell-item>
      <slot v-if="$slots.default"></slot>
      <template v-else>
        <e-cellbox middle class="placeholder-img-wrapper">
          <e-cell-item>
            <img v-if="src != 'none'" :src="src">
          </e-cell-item>
        </e-cellbox>
        <div class="placeholder-text weak">
          <slot v-if="$slots.text" name="text"></slot>
          <template v-else>
            {{text}}
          </template>
        </div>
        <slot v-if="$slots.button" name="button"></slot>
      </template>
    </e-cell-item>
  </e-cellbox>
</template>

<script>
  export default {
    componentName: 'EPlaceholder',
    props: {
      src: {
        type: String,
        default: '/static/images/default/placeholder.png'
      },
      text: {
        type: String,
        default: '没有相关数据'
      }
    }
  }
</script>
